package soup.net;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.EndPoint;

/**
 * This class contains the various kinds of messages sent between
 * client and server.
 * @author Sam
 *
 */
public class Messages {
		
	/**
	 * This method registers all of the message classes with
	 * the serialization system.
	 * @param ep
	 */
	static public void register(EndPoint ep) {
		Kryo k = ep.getKryo();
		k.register(Login.class);
		k.register(String[].class);
		k.register(UserList.class);
		k.register(Chat.class);
	}
	
	// client -> server; sent when client connects
	static public class Login {
		public String name;
	}
	
	// client <- server; sent when client connects
	static public class UserList {
		public String[] names;
	}
	
	// client <-> server; chat messages.
	static public class Chat {
		public String text;
	}
}
